package com.nowc.week.w103_ak;

import java.io.*;

public class c {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StreamTokenizer in = new StreamTokenizer(br);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        in.nextToken();
        long n = (long) in.nval;

        out.println(modPow(2, n - 1));
        out.flush();
        out.close();
        br.close();

    }

    static final int mod = 1000000007;

    static long modPow(long a, long e) {
        long res = 1;
        a %= mod;
        while (e > 0) {
            if ((e & 1) == 1) {
                res = (res * a) % mod;
            }
            a = (a * a) % mod;
            e >>= 1;
        }
        return res;
    }
}